package com.climb.spingcloud.service.impl;

import com.climb.spingcloud.entity.Product;
import com.climb.spingcloud.mapper.ProductMapper;
import com.climb.spingcloud.service.ProductService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.io.Serializable;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author filteraid
 * @since 2021-07-28
 */
@Service
public class ProductServiceImpl extends ServiceImpl<ProductMapper, Product> implements ProductService {

    //开启事务
    @Transactional(rollbackFor = Exception.class)
    @Override
    public Product getById(Serializable id) {
        return getBaseMapper().selectById(id);
    }
}
